﻿using System;
using System.Collections.Generic;
using SBPweb.Communication.Shared.Library.Contacts;
using Matrix.Xmpp.Client;
using SBPweb.Communication.Client.Library.Xmpp.Profiles;
using Matrix.Xmpp;
using Matrix;
using Matrix.Xmpp.Vcard;

namespace SBPweb.Communication.Client.Library.Xmpp.Commands
{

    partial class GetProfileCommand : Command<VcardIq, Matrix.Xmpp.Client.Iq>//VcardIq, Iq
    {

        public Profile Profile { get; protected set; }

        #region Methods

        public override VcardIq GetTypedRequest()
        {
            VcardIq viq = new VcardIq(IqType.get);
            viq.To = new Jid(contact.Id);
            return viq;
        }

        public override void PutTypedResponse(Matrix.Xmpp.Client.Iq response)
        {
            responseIq = response;
            Vcard v = response.Query as Vcard;

            Profile = new Profile(this.contact, v);
        }

        #endregion

    }

}